import { withRoutePage } from '@/utils/enhanceUtils';
import { connect } from 'umi';
import { Form } from 'antd';
import { OverviewRecheck } from '@/pages/SalaryManage/SalaryCalculate/Recheck/BaseOverviewRecheck';
import modelType from '@/pages/SalaryManage/SalaryCalculate/constant/modelTypeConstant';

const RecheckWithForm = Form.create({ name: 'HrOverviewRecheck' })(OverviewRecheck);
const namespace = 'hrOverviewRecheckModel';
const shareNamespace = 'recheckSharedModel';

const DISPATCH_TYPE = {
    initType: `${namespace}/${modelType.E_INIT}`,
    [modelType.E_RESET]: `${namespace}/${modelType.E_RESET}`,
    searchType: `${namespace}/${modelType.E_SEARCH}`,
    searchCondition: `${namespace}/${modelType.E_SEARCH_CONDITION}`,
    updateDataType: `${namespace}/${modelType.E_UPDATE_DATA}`,
    passCheck: `${namespace}/${modelType.E_PASS_CHECK}`,
    finalPassCheck: `${namespace}/${modelType.E_FINAL_PASS_CHECK}`,
    rejectCheck: `${namespace}/${modelType.E_REJECT_CHECK}`,
    finalRejectCheck: `${namespace}/${modelType.E_FINAL_REJECT_CHECK}`,
    [modelType.E_LOAD_STEP]: `${namespace}/${modelType.E_LOAD_STEP}`,
    sharedState: `${shareNamespace}/${modelType.E_SHARED_STATE}`
};

export default withRoutePage(
    connect(({ hrOverviewRecheckModel, recheckSharedModel, articleWagesModel, rejectTabModel }) => ({
        ...hrOverviewRecheckModel,
        ...recheckSharedModel,
        ...articleWagesModel,
        ...rejectTabModel,
        dispatchType: DISPATCH_TYPE
    }))(RecheckWithForm)
);
